<?php


namespace app\validate;

use think\Validate;

class DeviceCheck extends Validate
{
    protected $rule = [
        'id'=>'require',
        'user_id'=>'require',
        'name' => 'require',
        'sn'=>'require',
        'rate'=>'require',
        'speed'=>'require',
        'start_time'=>'require',
        'end_time' => 'require',
        'price' => 'require',
        'lat' => 'require',
        'lng' => 'require',
        'pic' => 'require',
        'images' => 'require',
        'service_price' => 'require',
        'park_id' => 'require',
        'page'=>'require'

    ];

    protected $message = [
        'id.require' => '电桩id不能为空',
        'user_id.require' => '用户id不能为空',
        'name.require' => '请输入电桩名称',
        'sn.require' => '请输入电桩编号',
        'rate.require' => '请输入功率',
        'speed.require' => '请选择快充/慢充',
        'start_time.require' => '请输入营业开始时间',
        'end_time.require'=>'请输入营业关闭时间',
        'price.require' => '请输入单价',
        'lat.require'=>'纬度不能为空',
        'lng.require'=>'经度不能为空',
        'pic.require' => '请上传头像',
        'images.require' => '请上传详情图片',
        'service_price.require'=>'请输入服务价格',
        'park_id.require' => '请选择车位',
        'page.require' => '请上传分页页码',
    ];

    protected $scene = [
        'device_info' => ['id','user_id'],
        'device_index' => ['user_id','page'],
        'device_del' => ['id','user_id'],
        'device_check' => ['user_id','name','rate','speed','start_time','end_time','lat','lng','pic','images','park_id'],
        'device_save' => ['id','user_id','name','rate','speed','start_time','end_time','lat','lng','pic','images','park_id'],
    ];
}